<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <img src="number/0.bmp" alt="" class="logoLeft">
        <img src="number/0.bmp" alt="" class="logoRight">
    </div>
    <div>
        <input type="button" value="开始" id="start" onclick="doStart()">
        <input type="button" value="停止" id="stop" onclick="doStop()">
    </div>
    <script>
        var r=0;
        var l=0;
        var timer;
        var logoLeft=document.querySelector(".logoLeft");
        var logoRight=document.querySelector(".logoRight");
        var start=document.getElementById("start");
        var stop=document.getElementById("stop");
        function go(){
            r++;
            if(r>9){
                r=0;
                l++;
            }
            if(l>9){
                r=0;
                l=0;
            }
            logoRight.src="number/"+r+".bmp";
            logoLeft.src="number/"+l+".bmp";
        }
        function doStart(){
            start.disabled=true;//禁用开始按钮
            stop.disabled=false;//启用停止按钮
            timer=setInterval(go,100);
        }
        function doStop(){
            start.disabled=false;//启用开始按钮
            stop.disabled=true;//禁用停止按钮
            clearInterval(timer);
        }

    </script>
</body>
</html>